'\" te
.\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
.\" Copyright 1989 AT&T
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH PROTOTYPE 5 "May 3, 2008"
.SH NAME
prototype \- package information file
.SH DESCRIPTION
.sp
.LP
\fBprototype\fR is an \fBASCII\fR file used to specify package information.
Each entry in the file describes a single deliverable object. An object can be
a data file, directory, source file, executable object, and so forth. This file
is generated by the package developer.
.sp
.LP
Entries in a \fBprototype\fR file consist of several fields of information
separated by white space. Comment lines begin with a ``\fB#\fR'' and are
ignored. The fields are described below and must appear in the order shown.
.sp
.ne 2
.na
\fB\fIpart\fR\fR
.ad
.RS 12n
An optional field designating the part number in which the object resides. A
part is a collection of files and is the atomic unit by which a package is
processed. A developer can choose criteria for grouping files into a part (for
example, based on class). If this field is not used, part 1 is assumed.
.RE

.sp
.ne 2
.na
\fB\fIftype\fR\fR
.ad
.RS 12n
A one-character field that indicates the file type. Valid values are:
.sp
.ne 2
.na
\fB\fBb\fR\fR
.ad
.RS 5n
block special device
.RE

.sp
.ne 2
.na
\fB\fBc\fR\fR
.ad
.RS 5n
character special device
.RE

.sp
.ne 2
.na
\fB\fBd\fR\fR
.ad
.RS 5n
directory
.RE

.sp
.ne 2
.na
\fB\fBe\fR\fR
.ad
.RS 5n
a file to be edited upon installation or removal (can be shared by several
packages)
.RE

.sp
.ne 2
.na
\fB\fBf\fR\fR
.ad
.RS 5n
a standard executable or data file
.RE

.sp
.ne 2
.na
\fB\fBi\fR\fR
.ad
.RS 5n
installation script or information file
.RE

.sp
.ne 2
.na
\fB\fBl\fR\fR
.ad
.RS 5n
linked file
.RE

.sp
.ne 2
.na
\fB\fBp\fR\fR
.ad
.RS 5n
named pipe
.RE

.sp
.ne 2
.na
\fB\fBs\fR\fR
.ad
.RS 5n
symbolic link
.RE

.sp
.ne 2
.na
\fB\fBv\fR\fR
.ad
.RS 5n
volatile file (one whose contents are expected to change, like a log file)
.RE

.sp
.ne 2
.na
\fB\fBx\fR\fR
.ad
.RS 5n
an exclusive directory accessible only by this package
.RE

.RE

.sp
.ne 2
.na
\fB\fIclass\fR\fR
.ad
.RS 12n
The installation class to which the file belongs. This name can be no longer
than 64 characters. The field is not specified for installation scripts.
(\fBadmin\fR and all classes beginning with capital letters are reserved class
names.)
.RE

.sp
.ne 2
.na
\fB\fIpathname\fR\fR
.ad
.RS 12n
The pathname where the file resides on the target machine, for example,
\fB/usr/bin/mail\fR or \fBbin/ras/proc\fR. Relative pathnames (those that do
not begin with a slash) indicate that the file is relocatable. The form
.sp
\fIpath1\fR\fB=\fR\fIpath2\fR
.sp
can be used for two purposes: to define a link and to define local pathnames.
.sp
For linked files, \fIpath1\fR indicates the destination of the link and
\fIpath2\fR indicates the source file. (This format is mandatory for linked
files.)
.sp
For local pathnames, \fIpath1\fR indicates the pathname an object should have
on the machine where the entry is to be installed and \fIpath2\fR indicates
either a relative or fixed pathname to a file on the host machine which
contains the actual contents.
.sp
A pathname can contain a variable specification of the form
\fB$\fR\fIvariable.\fR If \fIvariable\fR begins with a lower case letter, it is
a build variable. If \fIvariable\fR begins with an upper case letter, it is an
install variable. Build variables are bound at build time. If an install
variable is known at build time, its definition is inserted into the
\fBpkginfo\fR(5) file so that it is available at install time. If an install
variable is not known at build time, it is bound at install time.
.RE

.sp
.ne 2
.na
\fB\fImajor\fR\fR
.ad
.RS 12n
The major device number. The field is only specified for block or character
special devices.
.RE

.sp
.ne 2
.na
\fB\fIminor\fR\fR
.ad
.RS 12n
The minor device number. The field is only specified for block or character
special devices.
.RE

.sp
.ne 2
.na
\fB\fImode\fR\fR
.ad
.RS 12n
The octal mode of the file (for example, 0664). A question mark (\fB?\fR)
indicates that the mode is left unchanged, implying that the file already
exists on the target machine. This field is not used for linked files or
packaging information files.
.sp
The mode can be a variable specification of the form \fB$\fR\fIvariable.\fR If
\fIvariable\fR begins with a lower case letter, it is a build variable. If
\fIvariable\fR begins with an upper case letter, it is an install variable.
Build variables are bound at build time. If an install variable is known at
build time, its definition is inserted into the \fBpkginfo\fR(5) file so that
it is available at install time. If an install variable is not known at build
time, it is bound at install time.
.RE

.sp
.ne 2
.na
\fB\fIowner\fR\fR
.ad
.RS 12n
The owner of the file (for example, \fBbin\fR or \fBroot\fR). The field is
limited to 14 characters in length. A question mark (\fB?\fR) indicates that
the owner is left unchanged, implying that the file already exists on the
target machine. This field is not used for linked files or packaging
information files.
.sp
The owner can be a variable specification of the form \fB$\fR\fIvariable.\fR If
\fIvariable\fR begins with a lower case letter, it is a build variable. If
\fIvariable\fR begins with an upper case letter, it is an install variable.
Build variables are bound at build time. If an install variable is known at
build time, its definition is inserted into the \fBpkginfo\fR(5) file so that
it is available at install time. If an install variable is not known at build
time, it is bound at install time.
.RE

.sp
.ne 2
.na
\fB\fIgroup\fR\fR
.ad
.RS 12n
The group to which the file belongs (for example, \fBbin\fR or \fBsys\fR). The
field is limited to 14 characters in length. A question mark (\fB?\fR)
indicates that the group is left unchanged, implying that the file already
exists on the target machine. This field is not used for linked files or
packaging information files.
.sp
The group can be a variable specification of the form \fB$\fR\fIvariable.\fR If
\fIvariable\fR begins with a lower case letter, it is a build variable. If
\fIvariable\fR begins with an upper case letter, it is an install variable.
Build variables are bound at build time. If an install variable is known at
build time, its definition is inserted into the \fBpkginfo\fR(5) file so that
it is available at install time. If an install variable is not known at build
time, it is bound at install time.
.RE

.sp
.LP
An exclamation point (\fB!\fR) at the beginning of a line indicates that the
line contains a command. These commands are used to incorporate files in other
directories, to locate objects on a host machine, and to set permanent
defaults. The following commands are available:
.sp
.ne 2
.na
\fB\fBsearch\fR\fR
.ad
.RS 15n
Specifies a list of directories (separated by white space) to search for when
looking for file contents on the host machine. The base name of the \fIpath\fR
field is appended to each directory in the ordered list until the file is
located. Searches are not recursive.
.RE

.sp
.ne 2
.na
\fB\fBinclude\fR\fR
.ad
.RS 15n
Specifies a pathname which points to another prototype file to include. Note
that \fBsearch\fR requests do not span \fBinclude\fR files.
.RE

.sp
.ne 2
.na
\fB\fBdefault\fR\fR
.ad
.RS 15n
Specifies a list of attributes (mode, owner, and group) to be used by default
if attribute information is not provided for prototype entries which require
the information. The defaults do not apply to entries in \fBinclude\fR
prototype files.
.RE

.sp
.ne 2
.na
\fB\fIparam\fR\fB=\fR\fIvalue\fR\fR
.ad
.RS 15n
Places the indicated parameter in the current environment. Spans to subsequent
included prototype files.
.RE

.sp
.LP
The above commands can have variable substitutions embedded within them, as
demonstrated in the two example prototype files below.
.sp
.LP
Before files are overwritten during installation, they are copied to a
temporary pathname. The exception to this rule is files whose mode includes
execute permission, unless the file is editable (that is, \fIftype\fR is
\fBe\fR). For files which meet this exception, the existing version is linked
to a temporary pathname, and the original file is removed. This allows
processes which are executing during installation to be overwritten.
.SH EXAMPLES
.LP
\fBExample 1 \fRExample 1:
.sp
.in +2
.nf
!PROJDIR=/usr/proj
!BIN=$PROJDIR/bin
!CFG=$PROJDIR/cfg
!LIB=$PROJDIR/lib
!HDRS=$PROJDIR/hdrs
!search /usr/myname/usr/bin /usr/myname/src /usr/myname/hdrs
i pkginfo=/usr/myname/wrap/pkginfo
i depend=/usr/myname/wrap/depend
i version=/usr/myname/wrap/version
d none /usr/wrap 0755 root bin
d none /usr/wrap/usr/bin 0755 root bin
! search $BIN
f none /usr/wrap/bin/INSTALL 0755 root bin
f none /usr/wrap/bin/REMOVE 0755 root bin
f none /usr/wrap/bin/addpkg 0755 root bin
!default 755 root bin
f none /usr/wrap/bin/audit
f none /usr/wrap/bin/listpkg
f none /usr/wrap/bin/pkgmk
# the following file starts out zero length but grows
v none /usr/wrap/logfile=/dev/null 0644 root bin
# the following specifies a link (dest=src)
l none /usr/wrap/src/addpkg=/usr/wrap/bin/rmpkg
! search $SRC
!default 644 root other
f src /usr/wrap/src/INSTALL.sh
f src /usr/wrap/src/REMOVE.sh
f src /usr/wrap/src/addpkg.c
f src /usr/wrap/src/audit.c
f src /usr/wrap/src/listpkg.c
f src /usr/wrap/src/pkgmk.c
d none /usr/wrap/data 0755 root bin
d none /usr/wrap/save 0755 root bin
d none /usr/wrap/spool 0755 root bin
d none /usr/wrap/tmp 0755 root bin
d src /usr/wrap/src 0755 root bin
.fi
.in -2
.sp

.LP
\fBExample 2 \fRExample 2:
.sp
.in +2
.nf
\fB# this prototype is generated by 'pkgproto' to refer
# to all prototypes in my src directory
!PROJDIR=/usr/dew/projx
!include $PROJDIR/src/cmd/prototype
!include $PROJDIR/src/cmd/audmerg/protofile
!include $PROJDIR/src/lib/proto\fR
.fi
.in -2
.sp

.SH SEE ALSO
.sp
.LP
.BR pkgmk (1),
.BR pkginfo (5)
.sp
.LP
\fIApplication Packaging Developer\&'s Guide\fR
.SH NOTES
.sp
.LP
Normally, if a file is defined in the \fBprototype\fR file but does not exist,
that file is created at the time of package installation. However, if the file
pathname includes a directory that does not exist, the file is not created. For
example, if the \fBprototype\fR file has the following entry:
.sp
.in +2
.nf
\fBf none /usr/dev/bin/command\fR
.fi
.in -2
.sp

.sp
.LP
and that file does not exist, it is created if the directory \fB/usr/dev/bin\fR
already exists or if the \fBprototype\fR also has an entry defining the
directory:
.sp
.in +2
.nf
\fBd none /usr/dev/bin\fR
.fi
.in -2
.sp

